﻿using DeZhen.DataCollection.IRepository.CollectionTask;
using DeZhen.DataCollection.Model.Entities;
using SqlSugar;

namespace DeZhen.DataCollection.Repository.CollectionTask
{
    public class CollectionTaskDetailRepository : BaseRepository<CollectionTaskDetail>, ICollectionTaskDetailRepository
    {
        private readonly ISqlSugarClient _db;
        public CollectionTaskDetailRepository(ISqlSugarClient db) : base(db)
        {
            _db = db;
        }

        public async Task<List<CollectionTaskDetail>> GetListByTaskIdAsync(long taskId)
        {
            return await _db.Queryable<CollectionTaskDetail>()
                .Where(detail => detail.CollectionTaskId == taskId)
                .ToListAsync();
        }
    }
}
